home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / try_qb / flpt.bas (.txt) < prev    next >
Encoding:
QuickBASIC Tokenized Source  |  1989-12-04  |  2.5 KB  |  34 lines

  1. Bytes
  2.     RealValue
  3. AsLong
  4. Strout
  5. SignBit
  6. Exponent
  7. Mant1
  8.  FLPT.BASt
  9.  Displays how a given real value is stored in memory.
  10. Internal format of IEEE number (all values in hexadecimal)
  11.  Get the value and calculate the address of the variable.
  12. Enter a real number (or END to quit): 
  13.  Convert the real value to a long without changing any of
  14.  the bits.
  15.  Make a string of hex digits, and add leading zeroes.y
  16.  Save the sign bit, and then eliminate it so it doesn't
  17.  affect breaking out the bytes
  18.  Split the real value into four separate bytes
  19.  --the AND removes unwanted bits; dividing by 256 shifts
  20.  the value right 8 bit positions. 
  21.  Display how the value appears in memory.g
  22. Bytes in Memory"
  23.  High    Low
  24.  Set the value displayed for the sign bit.
  25.  The exponent is the right seven bits of byte 3 and thes
  26.  leftmost bit of byte 2. Multiplying by 2 shifts left and
  27.  makes room for the additional bit from byte 2.s
  28.  The first part of the mantissa is the right seven bitsn
  29.  of byte 2.  The OR operation makes sure the implied bit
  30.  is displayed by setting the leftmost bit.
  31.  Bit 31    Bits 30-23  Implied Bit & Bits 22-0
  32. Sign Bit  Exponent Bits     Mantissa Bits"
  33.  MHex$ makes sure we always get two hex digits.
  34.